﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/ADAdminLayout.master" AutoEventWireup="true" CodeFile="bao_cao_ban_hang.aspx.cs" Inherits="admin_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div class="block" id="block-tables">
        <div class="content">
            <h2 class="title">
                &nbsp;<a href=bao_cao_ban_hang.aspx>Thống kê theo doanh nghiệp</a>
&nbsp;&nbsp;
                <a href=bao_cao_ban_hang_thoi_gian.aspx>Thống kê theo tháng</a>
            </h2>
                <div class="inner">
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
        ConnectionString="<%$ ConnectionStrings:babydealConnectionString %>" 
        SelectCommand="SELECT doanh_nghiep.ten_doanh_nghiep,  SUM(khuyen_mai.gia_goc) AS Expr1 FROM doanh_nghiep INNER JOIN khuyen_mai ON doanh_nghiep.id = khuyen_mai.id_doanh_nghiep INNER JOIN mua_hang ON khuyen_mai.id = mua_hang.id_khuyen_mai GROUP BY doanh_nghiep.ten_doanh_nghiep">
    </asp:SqlDataSource>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CssClass="table" 
        DataSourceID="SqlDataSource1" Style="margin-right: 31px" CellPadding="4" PageSize="5" AlternatingRowStyle-CssClass="odd" RowStyle-CssClass="even">
        <Columns>
            <asp:BoundField DataField="ten_doanh_nghiep" HeaderText="Tên doanh nghiệp" 
                SortExpression="ten_doanh_nghiep" />
            <asp:BoundField DataField="Expr1" HeaderText="Tổng doanh thu" ReadOnly="True" 
                SortExpression="Expr1" />
        </Columns>
    </asp:GridView>
    </div>
    </div>
    </div>
</asp:Content>

